/*
 * @Author: yxfan
 * @Date: 2022-11-24 20:57:48
 * @LastEditTime: 2022-11-24 21:09:50
 * @FilePath: /umi-demo/src/pages/demo/EditTree/component.js
 * @Description:
 */
import { Input } from 'antd';
import { useState } from 'react';
export default (props) => {
  const [edit, setEdit] = useState(false);

  return (
    <div className="edit-com">
      {edit ? <Input /> : props.children}
      <div className="btns" style={{ display: edit ? 'block' : '' }}>
        <span style={{ marginLeft: '20px' }} onClick={() => setEdit(true)}>
          编辑
        </span>
        <span style={{ marginLeft: '20px' }} onClick={() => setEdit(false)}>
          关闭
        </span>
      </div>
    </div>
  );
};
